package com.xpalive.common;

import org.junit.jupiter.api.Test;

public class BaiyuanBaiji {
// 5cock + 3hen + 1/3 chick = 100
    // 15cock + 9hen + chick = 300;

    // cock + hen + chick = 100
    // 9cock + 9hen + 9chick = 900

    // 14cock + 8hen = 200
    // -6cock+8chick = 600;
    // hen = 200 - 14cock
    //
    // chick = 600/8+6/8cock
    @Test
    public void test1() {
        int cockf;
        float henf;
        float chickf;
        for (cockf = 1; cockf < 25; cockf++) {
            henf = 25f - (14f / 8f) * (float) cockf;
            chickf = 75f + (6f / 8f) * (float) cockf;
            if (henf > 0) {
                if ((int) henf == henf && (int) chickf == chickf) {
                    System.out.println("cock:" + cockf);
                    System.out.println("hen:" + (int) henf);
                    System.out.println("chick:" + (int) chickf);
                }
            }
        }
    }
}
